<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var num1 = prompt("输入第一个数：") * 1;
      var num2 = prompt("输入第二个数：") * 1;
      function min(num1, num2) {
        var maxi = num1;
        var mini = num2;
        var Num;
        if (maxi < mini) {
          var tem = maxi;
          maxi = mini;
          mini = tem;
        }
        for (var i = maxi; i != 0; i++) {
          if (i % maxi == 0 && i % mini == 0) {
            Num = i;
            break;
          }
        }
        return Num;
      }
      alert(num1 + "与" + num2 + "的最小公倍数是：" + min(num1, num2));
    </script>
  </body>
</html>
